<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="test">
        <span>你好</span>
    </div>
    <input type="text" value="hello">

    <script src="jquery-3.7.1.min.js"></script>
    <script>
       $(document).ready(function (){
            var text = $("#test").text();
            console.log("文本内容为:"+text);

            var html = $("#test").html();
            console.log("html内容为:"+html);

            var inputVal = $("input").val();
            console.log(inputVal);
       }); 
    </script>
</body>
</html>